//
//  GQInfoHeaderViewCell.m
//  GuQu
//
//  Created by HELIUM STAR on 15/5/18.
//  Copyright (c) 2015年 HELIUM STAR. All rights reserved.
//

#import "GQInfoHeaderViewCell.h"

@interface GQInfoHeaderViewCell ()

@property (weak, nonatomic) UIImageView *imageView;
@property (weak, nonatomic) UILabel *titleLabel;
@property (weak, nonatomic) UILabel *pageLabel;

@end

@implementation GQInfoHeaderViewCell

- (instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        [self setUpChildView];
    }
    return self;
}

- (void)setUpChildView
{
    UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.width, self.height)];
    self.imageView = imageView;
    [self.contentView addSubview:imageView];
    
    CGFloat titleHeight = 30;
    UIView *bottomView = [[UIView alloc] initWithFrame:CGRectMake(0, self.height - titleHeight, self.width, titleHeight)];
    UILabel *titleLable = [[UILabel alloc] initWithFrame:bottomView.frame];
    bottomView.backgroundColor = [UIColor blackColor];
    bottomView.alpha = 0.5;
    [self addSubview:bottomView];
    titleLable.font = [UIFont systemFontOfSize:14];
    titleLable.textColor = [UIColor whiteColor];
    self.titleLabel = titleLable;
    [self addSubview:titleLable];
    
    CGFloat height = 30;
    CGFloat width = 30;
    UILabel *pageLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.width - 35, titleLable.y, width, height)];
    pageLabel.textColor = [UIColor whiteColor];
    pageLabel.font = [UIFont systemFontOfSize:14];
    self.pageLabel = pageLabel;
   
    [self addSubview:pageLabel];
    
}

- (void)setImage:(UIImage *)image
{
    _image = image;
    self.imageView.image = image;
}

- (void)setTitleText:(NSString *)titleText
{
    _titleText = titleText;
    self.titleLabel.text= titleText;
}

- (void)setPageText:(NSString *)pageText{
    _pageText = pageText;
    self.pageLabel.text = pageText;
}


@end
